package com.qding.park.common.core.redis;

import java.util.List;
import java.util.Map;

import redis.clients.jedis.JedisPubSub;

public interface JedisClient {

	String get(String key);
	String set(String key, String value);
	String set(String key, String value,int ttl);
	String hget(String hkey, String key);
	 Map<String, String> hgetAll(String hkey);
	long hset(String hkey, String key, String value);
//	long hset(String hkey, String key, String value,int ttl);
	long incr(String key);
	long expire(String key, int second);
	long ttl(String key);
	long del(String key);
	long hdel(String hkey, String key);
	
	void delPattern(String key);
	
	Object get(String key,Class<?> objType);
	
//	String set(String key,Object value);
//	String set(String key,Object value,int ttl);
	
	String getSet(String key,String value);
	
	/********发布与订阅接口************/
	/**
	 * @Description (向主题发布　消息)
	 * @param channel
	 * @param message
	 * @return
	 */
	long publish(String channel, String message);
	
	/**
	 * @Description (订阅指定主题)
	 * @param jedisPubSub
	 * @param name
	 * @return
	 */
	void subscribe(JedisPubSub  jedisPubSub ,final String... channels);
	/********发布与订阅接口************/
	
	/*****消息队列**************/
	/**
	 * @Description (入队)
	 * @param key
	 * @param string
	 * @return
	 */
	public long  lpush(final String key, final String... string) ;
	
	public String rpop(final String key);
	
	public List<String> brpop(final String key);
	/*******************/
	
	public long setnx(String lockKey, int expireTime,String stringOfLockExpireTime);
	
	public long setnx(String key, String value);
}
